//
//  YHJAutoScrollView.h
//  Youhuiju
//
//  Created by yutenys on 16/7/20.
//  Copyright © 2016年 yutenys. All rights reserved.
//

#import <UIKit/UIKit.h>
@class YHJAutoScrollView;

@protocol YHJAutoScrollViewDatasource <NSObject>

- (NSUInteger)numberOfImageInScrollView:(YHJAutoScrollView *)scrollView;

- (void)scrollView:(YHJAutoScrollView *)scrollView imageAtIndex:(NSUInteger)index forImageView:(UIImageView *)imageView;

@end

@protocol YHJAutoScrollViewDelegate <NSObject>

@optional
- (void)scrollView:(YHJAutoScrollView *)scrollView didTappedImageAtIndex:(NSUInteger)index;
- (void)scrollView:(YHJAutoScrollView *)scrollView didDidScrollToPage:(NSUInteger)page;

@end

@interface YHJAutoScrollView : UIView

@property (nonatomic, assign) id<YHJAutoScrollViewDatasource> autoScrollDataSource;
@property (nonatomic, assign) id<YHJAutoScrollViewDelegate> autoScrollDelegate;

@property (nonatomic, strong) UIPageControl *pageControl;
@property (nonatomic, strong) UIScrollView *scrollView;
@property (nonatomic, assign) IBInspectable BOOL shouldAutoScroll;//是否自动轮播，默认YES
@property (nonatomic, assign) IBInspectable double autoScrollInterval;//自动轮播时间间隔，默认5s

/**
 *  当数据源改变时，刷新数据
 */
- (void)reloadData;

@end
